/*
 * wrote by casper 2007.12.1
 */
package ants.p2p.security.sockets;

import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.IOException;

public class ObjectSocketOutputStream {
	ObjectOutputStream oos;
	OutputStream os;

	public ObjectSocketOutputStream(OutputStream out) throws IOException {
		os = out;
		oos = new ObjectOutputStream(os);
	}

	public void writeInt(int val) throws IOException {
		oos.writeInt(val);
	}

	public void writeObject(Object obj) throws IOException {
		oos.writeObject(obj);
	}

	public void writeObjectWithFlush(Object obj) throws IOException {
		oos.writeObject(obj);
		flush();
	}

	public void flush() throws IOException {
		oos.flush();
		os.flush();
	}
}
